#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
    int n;
    int a[10];
    int i= 0;
    cin >> n;
    for(int j = 0; j<n; j++)
    {
        cin >> a[i];
        i++;
        
    }
    int index = 0;
    int max = a[0];
    for(int j = 1; j<n; j++)
    {
        if(a[j] > max)
        {
            max = a[j];
            index = j;
        }
    }
    cout << max << " " << index;
    
}